@echo off
setlocal enabledelayedexpansion

set file=package.json
set file_tmp=package_tmp.json
set file_bak=package_bak.json
set source1=avue-blank-init
rem set  source2=180

for %%a in ("%cd%") do set replaced1=%%~nxa
rem set replaced2=80

for /f "delims=" %%i in (%file%) do (
    set str=%%i
        set "str=!str:%source1%=%replaced1%!"
        rem set "str=!str:%source2%=%replaced2%!"
        echo !str!>>%file_tmp%
)
rem copy "%file%" "%file_bak%" >nul 2>nul
move "%file_tmp%" "%file%"

cd ./public/
set file=index.html
set file_tmp=index_tmp.html
set file_bak=index_bak.html

for /f "delims=" %%i in (%file%) do (
    set str=%%i
        set "str=!str:%source1%=%replaced1%!"
        rem set "str=!str:%source2%=%replaced2%!"
        echo !str!>>%file_tmp%
)
move "%file_tmp%" "%file%"


